projects
/
cargo.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
88e3081
)
Remove submodule directory before cloning
author
Alex Crichton
<alex@alexcrichton.com>
Thu, 14 Apr 2016 17:40:36 +0000
(10:40 -0700)
committer
Alex Crichton
<alex@alexcrichton.com>
Thu, 14 Apr 2016 17:40:36 +0000
(10:40 -0700)
If the directory is in a corrupt state that caused an existing repository to not
successfully open, then we'll want to blow it away anything that already exists
to ensure we start from a clean slate.
Closes #2567
src/cargo/sources/git/utils.rs
patch
|
blob
|
history
diff --git
a/src/cargo/sources/git/utils.rs
b/src/cargo/sources/git/utils.rs
index d865262d080c28c99aa74dd86075b5f337e6668c..74ae03398dceb9b7345f056d9ff94d61635a7059 100644
(file)
--- a/
src/cargo/sources/git/utils.rs
+++ b/
src/cargo/sources/git/utils.rs
@@
-339,6
+339,7
@@
impl<'a> GitCheckout<'a> {
}
Err(..) => {
let path = repo.workdir().unwrap().join(child.path());
+ let _ = fs::remove_dir_all(&path);
try!(git2::Repository::clone(url, &path))
}
};